const express = require('express');
const { getShopTables, selectTable, releaseTable } = require('../controllers/tableController');
const { auth } = require('../middleware/auth');

const router = express.Router();

// 应用认证中间件
router.use(auth);

// 获取餐厅的桌位列表
router.get('/shop/:shopId/tables', getShopTables);

// 选择桌位
router.post('/table/:tableId/select', selectTable);

// 释放桌位
router.post('/table/:tableId/release', releaseTable);

module.exports = router;